var vm = new Vue({
	el: "#daoyou",
	data: {
		dlist: getGui()
	},

	methods: {
		getImgUrl(item) {
			var url = 'http://114.55.145.243:8080/img/img/' + item + '.jpg';
			return url;
		},

		getClass(item) {
			if(item == "女")
				return 'woman';
			if(item == "男")
				return 'man';
		},
		getage(item) {
			var age;
			switch(item) {
				case '1970':
					age="70后"
					break;
				case '1980':
					age="80后"
					break;
				case '1985':
					age="85后"
					break;
				case '1990':
					age="90后"
					break;
				case '1995':
					age="95后"
					break;
				case '2000':
					age="00后"
					break;
				default:
					break;
			}
			return age
		},
		getCar(item){
			if(item==0){
				return "(不含车)"
			}else
				return "(含车)"
		},
		getGuihref(item) {
			var url = 'daoyou_detail.html?gui_id='+item;
						//						var url = 'https://api.weixin.qq.com/cgi-bin/media/get?access_token=' + token + '&media_id=' + item;
			return url;
		}

	}
})


function getGui() {
	var glist = {}
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/GuideServlet/selectGuideByProvinceName?",
		async: false,
		xhrFields: {
			withCredentials: true
		},
		data:GetRequest(),
		success: function(data) {
			if(data.data) {
				glist = data.data
			} 
		},
		dataType: "json"

	})
	return glist
}

function getGuiService(item) {
	var glist = {}
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/ServiceServlet/selectServiceByGid?",
		async: false,
		data: {ser_guide:item},
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.data) {
				glist = data.data
			} 
		},
		dataType: "json"

	})
	return glist
}

function getOrders1(item){
	var orders;
	$.ajax({
		url:"http://114.55.145.243:8080/liantu/OrderServlet/selectOrderByGid?",
		async:false,
		data:{gui_id:item},
		xhrFields: {
			withCredentials: true
		},
		success:function(data){
			if(data.data){
				orders=data.data
			}
			
		},
		dataType:"json"
		
	})
	return orders
}
